var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
import { defineComponent, ref, computed, onMounted, h, watch, nextTick, onBeforeUnmount, resolveComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, withModifiers, toDisplayString, normalizeStyle, createVNode, withDirectives, Fragment, renderList, createBlock, vShow, withCtx, unref, createTextVNode } from "vue";
import { ElIcon, ElSelect, ElOption, ElInput, ElMessageBox, ElMessage } from "element-plus";
import { CircleClose, CircleCheck, Plus, Minus } from "@element-plus/icons-vue";
import { defineStore } from "pinia";
const _sfc_main$5 = defineComponent({
  name: "NodeValue",
  props: {
    data: {
      type: Object,
      required: true
    },
    readonly: {
      type: Boolean,
      required: true
    }
  },
  setup(props, context) {
    const isHasFocus = ref(false);
    const validText = ref("");
    const checkText = ref("");
    const validTypeArr = ["Integer", "BitString", "NumericString", "Ia5string", "OctetString", "String"];
    const otherProps = computed(() => {
      return props.data.bitArray ? props.data.bitArray.map((x) => x ? 1 : 0).join("") : "";
    });
    const formValid = (data) => {
      if (data.isRequired && data.value === "") {
        validText.value = "字段必填";
        return;
      }
      if (data.controlType === "Integer") {
        const { minInclusive, maxInclusive, value } = data;
        if (!minInclusive && !maxInclusive) {
          checkText.value = validText.value = "";
          return;
        }
        if (Number(value) < minInclusive) {
          validText.value = `最小值为${minInclusive}`;
          return;
        }
        if (Number(value) > maxInclusive) {
          validText.value = `最大值为${maxInclusive}`;
          return;
        }
      } else if (data.controlType === "BitString") {
        const { Length } = data;
        checkText.value = `长度为${Length}的二进制数`;
        if (otherProps.value.length !== Length) {
          validText.value = `长度应为${Length}`;
          return;
        }
      }
      validText.value = "";
    };
    const updateEmit = () => {
      if (validText.value === "") {
        context.emit("updateForm", props.data);
      }
    };
    const publicEvent = {
      onfocus: () => {
        isHasFocus.value = true;
      },
      onblur: () => {
        isHasFocus.value = false;
      }
    };
    onMounted(() => {
    });
    const strategy = {
      Integer: (data) => {
        const { value, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          disabled,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: (val) => {
            if (!value) return;
            data.value = parseFloat(val);
            updateEmit();
          },
          ...publicEvent
        });
      },
      Ia5string: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: () => {
            updateEmit();
          },
          ...publicEvent
        });
      },
      String: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: () => {
            updateEmit();
          },
          ...publicEvent
        });
      },
      OctetString: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          attrs: { minlength: minLength, readonly: props.readonly },
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: (val) => {
            const is16Hex = /^[\-A-Fa-f0-9\s]*$/.test(val);
            if (is16Hex) {
              const newValue = value !== "" ? String(value).replace(/\s+/g, "").match(new RegExp("[^\\n]{1,2}", "g")).join(" ") : "";
              data.value = newValue;
              formValid(data);
              updateEmit();
            }
          }
        });
      },
      // NumericString: (data: nodeItem) => {
      //   const { Value: value, MinLength, IsReadOnly: disabled } = data;
      //   return h("el-input", {
      //     class: "int-input",
      //     props: { value, disabled },
      //     attrs: { minlength: MinLength, readonly: props.readonly },
      //     on: {
      //       input: (value: string) => {
      //         const isNumber = /^[\.\-0-9]*$/.test(value);
      //         if (isNumber) {
      //           data.Value = value;
      //           formValid(data);
      //         }
      //       },
      //       ...publicEvent,
      //     },
      //   });
      // },
      // BitString: (data: nodeItem) => {
      //   const { IsReadOnly: disabled } = data;
      //   const { value } = otherProps;
      //   return h("el-input", {
      //     class: "int-input",
      //     props: { otherProps.value.value, disabled },
      //     attrs: { readonly: props.readonly },
      //     on: {
      //       input: (value: string) => {
      //         const isBinary = /^[0|1]*$/.test(value);
      //         if (isBinary) {
      //           data.OtherProps = value;
      //           formValid(data);
      //         }
      //       },
      //       change: (value: string) => {
      //         data.BitArray = value.split("").map(x => !!Number(x));
      //       },
      //       ...publicEvent,
      //     },
      //   });
      // },
      Enum: (data) => {
        const { value, constraint, isReadOnly: disabled } = data;
        const options = [];
        constraint == null ? void 0 : constraint.forEach((optionValue) => {
          options.push({ label: optionValue, value: optionValue });
        });
        return h(
          ElSelect,
          {
            class: "custom-el-select",
            // 添加自定义类名
            modelValue: data.value,
            "onUpdate:modelValue": (val) => {
              data.value = val;
            },
            onChange: () => {
              updateEmit();
            },
            size: "small"
          },
          [
            ...options.map(
              (option) => h(ElOption, {
                key: option.value,
                label: option.label,
                value: option.value
              })
            )
          ]
        );
      },
      // Choice: (data: nodeItem) => {
      //   const { Value: value, Constraint, IsReadOnly: disabled } = data;
      //   const optionsArr = Constraint.map(value => {
      //     if (typeof value === "string") return;
      //     return h("el-option", { props: { label: value.Name, value } });
      //   });
      //   return h(
      //     "el-select",
      //     {
      //       class: "enum-select",
      //       props: { value, valueKey: "Name", placeholder: " ", disabled: disabled || props.readonly },
      //       on: {
      //         input: (value: string) => {
      //           data.Value = value;
      //         },
      //       },
      //     },
      //     [optionsArr],
      //   );
      // },
      Boolean: (data) => {
        const options = [
          { label: "是", value: true },
          { label: "否", value: false }
        ];
        return h(
          ElSelect,
          {
            class: "custom-el-select",
            // 添加自定义类名
            modelValue: data.value,
            "onUpdate:modelValue": (val) => {
              data.value = val;
            },
            onChange: () => {
              updateEmit();
            },
            size: "small"
          },
          [
            ...options.map(
              (option) => h(ElOption, {
                label: option.label,
                value: option.value
              })
            )
          ]
        );
      },
      Sequence: () => {
        return h("div", {}, "");
      },
      SequenceList: (data) => {
        const max = 9999;
        const min = 0;
        const len = data.child && data.child.length;
        const elementName = "成员";
        return h("div", { class: "sequence-list-value" }, [
          h(
            "div",
            {
              class: "btn-icon"
            },
            [
              h(
                ElIcon,
                {
                  class: `el-icon-plus ${len < max ? "" : "gray"}`,
                  onClick: () => {
                    if (len < max) {
                      const addRow = data.elementForm;
                      const count = data.child ? data.child.length + 1 : 1;
                      if (addRow) {
                        addRow.name = `${elementName}(${count})`;
                      }
                      data.child.push(JSON.parse(JSON.stringify(addRow)));
                      updateEmit();
                    }
                  }
                },
                [h(Plus)]
              ),
              h(
                ElIcon,
                {
                  class: `el-icon-minus ${len > min ? "" : "gray"}`,
                  onClick: () => {
                    if (len > min) {
                      data.child.pop();
                      updateEmit();
                    }
                  }
                },
                [h(Minus)]
              )
            ]
          )
          // h("span", { class: "valid-text" }, validText),
        ]);
      },
      // 其他控件类型的渲染逻辑...
      default: (data) => {
        return h("div", {}, `未定义的控件类型: ${data.controlType}`);
      }
    };
    formValid(props.data);
    return () => {
      return h(
        "div",
        {
          class: {
            "node-value": true,
            "node-valid-error": validText.value
          }
        },
        [
          (strategy[props.data.controlType] || strategy.default)(props.data),
          validTypeArr.includes(props.data.controlType) && h("span", { class: "valid-icon" }, [
            [
              validText.value ? h(ElIcon, { color: "red", size: 16 }, [h(CircleClose)]) : isHasFocus.value && !props.readonly && h(ElIcon, { color: "#67c23a", size: 16 }, [h(CircleCheck)])
            ],
            isHasFocus.value && validText.value && h("div", { class: "valid-tips err" }, validText.value),
            !validText.value && !props.readonly && isHasFocus.value && checkText.value && h("div", { class: "valid-tips" }, checkText.value)
          ])
        ]
      );
    };
  }
});
const _export_sfc$1 = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const NodeValue = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__scopeId", "data-v-a8b820df"]]);
const systolicIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="HTSCIT_&#229;&#177;&#149;&#229;&#188;&#128; 2">\r\n<path id="Vector" d="M6.27673 6.28553H17.7233V17.7409H6.27673V6.28553ZM5 5.00881V19H19V5H5V5.00881Z" fill="currentColor"/>\r\n<path id="Vector_2" d="M8 13V11H16V13H8Z" fill="#3a6ef6"/>\r\n</g>\r\n</svg>\r\n';
const expandIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="HTSCIT_&#229;&#177;&#149;&#229;&#188;&#128; 1">\r\n<path id="Vector" d="M6.27673 6.28553H17.7233V17.7409H6.27673V6.28553ZM5 5.00881V19H19V5H5V5.00881Z" fill="currentColor"/>\r\n<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M12.5471 8.1925H11.4528V11.4642H8.18115V12.5585H11.4528V15.8302H12.5471V12.5585H15.8189V11.4642H12.5471V8.1925Z" fill="#3a6ef6"/>\r\n</g>\r\n</svg>\r\n';
const toolIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M13.9498 6C14.8591 6 15.699 6.29966 16.3746 6.80641L15.1183 8.06172L13.892 9.28926L14.7099 10.1078L17.1925 7.62438C17.7138 8.32091 17.997 9.16685 18 10.0369C18.003 10.9069 17.7257 11.7548 17.2093 12.4549C16.6928 13.1551 15.9646 13.6702 15.1325 13.9241C14.3004 14.178 13.4087 14.1571 12.5894 13.8645L8.98345 17.4702C8.82338 17.6359 8.6319 17.7682 8.42019 17.8591C8.20848 17.9501 7.98077 17.9979 7.75036 17.9999C7.51995 18.0019 7.29145 17.958 7.07819 17.8708C6.86493 17.7835 6.67118 17.6546 6.50825 17.4917C6.34532 17.3288 6.21647 17.135 6.12922 16.9217C6.04197 16.7084 5.99806 16.4799 6.00007 16.2495C6.00207 16.019 6.04994 15.7913 6.14088 15.5796C6.23183 15.3678 6.36402 15.1763 6.52976 15.0163L10.1351 11.41C9.9171 10.7988 9.84914 10.1442 9.93696 9.5013C10.0248 8.85838 10.2658 8.24598 10.6397 7.71569C11.0137 7.1854 11.5095 6.75274 12.0856 6.45416C12.6616 6.15558 13.301 5.99982 13.9498 6Z" fill="currentColor"/>\r\n</svg>\r\n';
const _sfc_main$4 = defineComponent({
  name: "NodeItem",
  components: {
    NodeValue
  },
  props: {
    data: {
      type: Object,
      required: true
    },
    w: {
      type: Number,
      required: true
    },
    readonly: {
      type: Boolean,
      required: true
    }
  },
  setup(props, { emit }) {
    const isExpand = ref(props.data.isExpand !== false);
    const isChildren = computed(() => {
      return props.data.child && props.data.child.length > 0;
    });
    const handleUpdate = (data) => {
      emit("updateForm", data);
    };
    return {
      isExpand,
      isChildren,
      handleUpdate,
      systolicIcon,
      expandIcon,
      toolIcon
    };
  }
});
const _hoisted_1$2 = { class: "node-view" };
const _hoisted_2$2 = { class: "node-item" };
const _hoisted_3$1 = { class: "left-item" };
const _hoisted_4 = { class: "icon-view" };
const _hoisted_5 = ["innerHTML"];
const _hoisted_6 = ["innerHTML"];
const _hoisted_7 = { class: "label-view" };
const _hoisted_8 = {
  key: 0,
  class: "node-children"
};
const _hoisted_9 = {
  key: 1,
  class: "node-children"
};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_NodeValue = resolveComponent("NodeValue");
  const _component_NodeItem = resolveComponent("NodeItem", true);
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
    createElementVNode("div", _hoisted_2$2, [
      createElementVNode("div", _hoisted_3$1, [
        createElementVNode("div", _hoisted_4, [
          _ctx.isChildren ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: "ex-icon force-svg-16",
            innerHTML: _ctx.isExpand ? _ctx.systolicIcon : _ctx.expandIcon,
            onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.isExpand = !_ctx.isExpand, ["stop"]))
          }, null, 8, _hoisted_5)) : (openBlock(), createElementBlock("span", {
            key: 1,
            class: "icon",
            innerHTML: _ctx.toolIcon
          }, null, 8, _hoisted_6))
        ]),
        createElementVNode("div", _hoisted_7, toDisplayString(_ctx.data.name), 1)
      ]),
      createElementVNode("div", {
        class: "right-item",
        style: normalizeStyle({ width: _ctx.w ? `${_ctx.w / 2}px` : "" })
      }, [
        createVNode(_component_NodeValue, {
          data: _ctx.data,
          readonly: _ctx.readonly,
          onUpdateForm: _ctx.handleUpdate
        }, null, 8, ["data", "readonly", "onUpdateForm"])
      ], 4)
    ]),
    _ctx.isChildren ? (openBlock(), createElementBlock("div", _hoisted_8, [
      withDirectives(createElementVNode("div", null, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.child, (x, i) => {
          return openBlock(), createBlock(_component_NodeItem, {
            key: i,
            data: x,
            w: _ctx.w,
            readonly: _ctx.readonly,
            onUpdateForm: _ctx.handleUpdate
          }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
        }), 128))
      ], 512), [
        [vShow, _ctx.isExpand]
      ])
    ])) : createCommentVNode("", true),
    _ctx.data.controlType === "Choice" && _ctx.data.value ? (openBlock(), createElementBlock("div", _hoisted_9, [
      (openBlock(true), createElementBlock(Fragment, null, renderList([_ctx.data.value], (x, i) => {
        return openBlock(), createBlock(_component_NodeItem, {
          key: i,
          data: x,
          w: _ctx.w,
          readonly: _ctx.readonly,
          onUpdateForm: _ctx.handleUpdate
        }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
      }), 128))
    ])) : createCommentVNode("", true)
  ]);
}
const NodeItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-49690e0a"]]);
defineComponent({
  name: "NodeTree",
  components: {
    NodeItem
  },
  props: {
    data: {
      type: Array,
      required: true
    },
    isHideHeader: {
      type: Boolean,
      default: false
    },
    readonly: {
      type: Boolean,
      default: false
    },
    isLoading: {
      type: Boolean,
      default: false
    }
  },
  setup(props, { emit }) {
    const treeTbodyW = ref(0);
    const treeTbody = ref(null);
    const scrollbar = ref(null);
    watch(
      () => props.data.length,
      () => {
        nextTick(() => {
          updateTreeTbodyWidth();
        });
      }
    );
    const updateTreeTbodyWidth = () => {
      if (treeTbody.value) {
        treeTbodyW.value = treeTbody.value.offsetWidth;
      }
    };
    const handleResize = () => {
      updateTreeTbodyWidth();
    };
    onMounted(() => {
      window.addEventListener("resize", handleResize);
    });
    onBeforeUnmount(() => {
      window.removeEventListener("resize", handleResize);
    });
    const handleUpdate = (data) => {
      emit("updateForm", data);
    };
    return {
      treeTbodyW,
      treeTbody,
      scrollbar,
      handleUpdate
    };
  }
});
const SEND_TASK_CMD_KEY = "send-task-cmd";
const GET_TASK_DATA_KEY = "get-task-data";
const useTaskStore = defineStore("taskInjection", () => {
  const sendTaskCmd = ref(null);
  const setInjections = (injections) => {
    if (injections.sendTaskCmd) {
      sendTaskCmd.value = injections.sendTaskCmd;
    }
  };
  return { sendTaskCmd, setInjections };
});
function createCommand(moduleId, fixedParams) {
  return async function(data, params, config2 = {}) {
    const calibStore = useTaskStore();
    const sendTaskCmd = calibStore.sendTaskCmd;
    if (!sendTaskCmd) {
      throw new Error("sendTaskCmd 未在 Pinia 中初始化，请检查插件根组件是否正常挂载");
    }
    const commandPayload = {
      moduleId,
      fixedParams,
      data,
      params: { ...fixedParams, ...params },
      config: config2
    };
    const result = await sendTaskCmd("execute", commandPayload);
    return result;
  };
}
const moudleType = "TaskForm";
const getMethodDescription = createCommand(moudleType, { commandName: "GetMethodDescription", requestMethod: "GET" });
const getTaskListByCondition = createCommand(moudleType, { commandName: "GetTaskListByCondition" });
const routerLinkTestView = createCommand(moudleType, { commandName: "RouterLink" });
const deleteTask = createCommand(moudleType, { commandName: "DeleteTask" });
const getTaskSolutions = createCommand(moudleType, { commandName: "GetTaskSolutions" });
const getAllManufacturers = createCommand(moudleType, { commandName: "GetAllManufacturers" });
const _hoisted_1 = { class: "list-view" };
const _hoisted_2 = { class: "filter-view" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "TaskView",
    components: {}
  },
  __name: "index",
  setup(__props, { expose: __expose }) {
    const dataEvent = (data) => {
      console.log("子组件收到数据了", data);
    };
    __expose({
      dataEvent
    });
    const taskStore = useTaskStore();
    console.log("存储后 Pinia 中的值：", taskStore.sendTaskCmd);
    const queryFormRef = ref();
    const query = ref({ pageIndex: 1, pageSize: 30, manufactureName: "", solutionName: "", taskName: "", testTime: "" });
    const state = ref("");
    const total = ref(0);
    const tableConfig = [
      {
        label: "任务名称1",
        prop: "taskName",
        type: "link",
        onClick: async (row) => {
          console.log("行数据：准备跳转", row);
          await routerLinkTestView("/testView?taskId=" + row.taskId);
        }
      },
      { label: "设备型号", prop: "dutMode" },
      { label: "统计信息", prop: "testProcess", type: "slot", slot: "progress" },
      { label: "解决方案", prop: "solutionName" },
      { label: "设备厂家", prop: "manufacturer" },
      { label: "检测日期", prop: "taskTestTime" }
    ];
    const tableData = ref([]);
    const queryFilterConfig = ref([
      { placeholder: "请输入任务名称", prop: "taskName" },
      { placeholder: "请选择解决方案", prop: "solutionName", type: "select", options: [] },
      { placeholder: "请选择设备厂家", prop: "manufactureName", type: "select", options: [] },
      { placeholder: "请选择检测日期", prop: "testTime", type: "date", format: "YYYY/MM/DD", valueFormat: "YYYY/MM/DD" }
    ]);
    onMounted(async () => {
      const descResult = await getMethodDescription();
      console.log("接口方法描述内容", descResult);
      console.log("准备渲染插件页面");
      getList();
      getSolutions();
      getFacturers();
    });
    const getList = async () => {
      state.value = "loading";
      const {
        data: { list, total_Count }
      } = await getTaskListByCondition(query.value);
      console.log("获取的数据", list);
      state.value = "";
      tableData.value = (list || []).map((it) => {
        it.testProcess = isNaN(Number(it.testProcess)) ? "0" : it.testProcess;
        return it;
      });
      total.value = total_Count || 0;
    };
    const getSolutions = async () => {
      const { data } = await getTaskSolutions({});
      const row = queryFilterConfig.value.find((it) => it.prop === "solutionName");
      if (row) {
        row.options = (data || []).map((it) => {
          return { label: it, value: it };
        });
      }
    };
    const getFacturers = async () => {
      const { data } = await getAllManufacturers({});
      const row = queryFilterConfig.value.find((it) => it.prop === "manufactureName");
      if (row) {
        row.options = (data || []).map((it) => {
          return { label: it, value: it };
        });
      }
    };
    let queryFilter = async ({ value, done }) => {
      query.value.pageIndex = 1;
      query.value = { ...query.value, ...value };
      await getList();
      done == null ? void 0 : done();
    };
    const onDelete = async (row) => {
      await ElMessageBox({
        title: "提示",
        message: `是否确定删除任务“${row.taskName}”?`,
        type: "warning",
        showCancelButton: true,
        beforeClose: async (action, instance, done) => {
          if (action === "confirm") {
            try {
              instance.confirmButtonLoading = true;
              instance.confirmButtonText = `执行中...`;
              await deleteTask({ taskId: row.taskId });
              done();
            } catch {
              instance.confirmButtonText = `确定`;
            }
            instance.confirmButtonLoading = false;
          } else {
            done();
          }
        }
      });
      ElMessage.closeAll();
      ElMessage.success(`删除成功`);
      getList();
    };
    const progressColor = (val) => {
      return val < 80 ? val < 50 ? "#f56c6c" : "#e6a23c" : "";
    };
    const toAdd = async () => {
      console.log("跳转新建任务");
      await routerLinkTestView("/addTask");
    };
    return (_ctx, _cache) => {
      const _component_el_link = resolveComponent("el-link");
      const _component_el_button = resolveComponent("el-button");
      const _component_XcForm = resolveComponent("XcForm");
      const _component_el_progress = resolveComponent("el-progress");
      const _component_XcTable = resolveComponent("XcTable");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_XcTable, {
          class: "is-list",
          ref: "tableView",
          tableKey: _ctx.$route.path,
          page: query.value.pageIndex,
          "onUpdate:page": _cache[0] || (_cache[0] = ($event) => query.value.pageIndex = $event),
          limit: query.value.pageSize,
          "onUpdate:limit": _cache[1] || (_cache[1] = ($event) => query.value.pageSize = $event),
          pageTotal: total.value,
          config: tableConfig,
          state: state.value,
          values: tableData.value,
          formRef: queryFormRef.value,
          operationWidth: "100px",
          pagingConfig: { background: true },
          onUpdate: getList
        }, {
          default: withCtx(({ row }) => [
            row.account !== "admin" ? (openBlock(), createBlock(_component_el_link, {
              key: 0,
              size: "small",
              type: "danger",
              underline: false,
              onClick: ($event) => onDelete(row)
            }, {
              default: withCtx(() => [..._cache[2] || (_cache[2] = [
                createTextVNode("删除", -1)
              ])]),
              _: 2
            }, 1032, ["onClick"])) : createCommentVNode("", true)
          ]),
          actions: withCtx(() => [
            createElementVNode("div", _hoisted_2, [
              createVNode(_component_el_button, {
                type: "primary",
                icon: unref(Plus),
                onClick: toAdd
              }, {
                default: withCtx(() => [..._cache[3] || (_cache[3] = [
                  createTextVNode("新建任务", -1)
                ])]),
                _: 1
              }, 8, ["icon"]),
              createVNode(_component_XcForm, {
                config: queryFilterConfig.value,
                ref_key: "queryFormRef",
                ref: queryFormRef,
                isQueryFilter: "",
                onSubmit: unref(queryFilter)
              }, null, 8, ["config", "onSubmit"])
            ])
          ]),
          progress: withCtx(({ row }) => [
            createVNode(_component_el_progress, {
              percentage: Number(row.testProcess),
              color: progressColor(row.testProcess)
            }, null, 8, ["percentage", "color"])
          ]),
          _: 1
        }, 8, ["tableKey", "page", "limit", "pageTotal", "state", "values", "formRef"])
      ]);
    };
  }
});
const _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const TaskForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ea32025b"]]);
const config = {
  moudleType: "TaskForm",
  name: "任务模块",
  version: "1.0.0",
  description: "任务列表查询"
};
class TaskModule {
  constructor(sendCmd, initialData = {}) {
    __publicField(this, "config", config);
    __publicField(this, "_eventData");
    __publicField(this, "sendCmd");
    this._eventData = ref(initialData);
    this.sendCmd = sendCmd;
  }
  sendCommand(cmd, cmdParams) {
    console.log("发送指令：", cmd, cmdParams);
    return this.sendCmd(this.config.moudleType, cmd, cmdParams);
  }
  install(app) {
    app.component("TaskForm", TaskForm);
    app.provide(GET_TASK_DATA_KEY, () => this.eventData);
    app.provide(SEND_TASK_CMD_KEY, (cmd, cmdParams) => {
      console.log("插件内部转发指令：", cmd, cmdParams);
      return this.sendCommand(cmd, cmdParams);
    });
  }
  get eventData() {
    return this._eventData;
  }
  dataEvent(data) {
    Object.assign(this._eventData, data);
  }
  async startup() {
    const taskStore = useTaskStore();
    if (!taskStore.sendTaskCmd) {
      console.log("Pinia 中未存储 sendTaskCmd,进行存储");
      taskStore.setInjections({
        sendTaskCmd: (cmd, cmdParams) => this.sendCommand(cmd, cmdParams)
      });
    }
    console.log("插件根组件获取到 sendTaskCmd,初始化成功", taskStore.sendTaskCmd);
    console.log("存储后 Pinia 中的值：", taskStore.sendTaskCmd);
    console.log("任务模块初始化完成");
  }
}
const createTaskModule = (sendCmd, initialData) => {
  return new TaskModule(sendCmd, initialData);
};
export {
  TaskForm,
  createTaskModule
};
